Skip to main content

Error Format

All errors return a consistent JSON shape:

{
"error": "Human readable message",
"code": "VALIDATION_ERROR",
"requestId": "optional-uuid-for-prepare-failures"
}

Error codes

CodeDescription
VALIDATION_ERRORInvalid request body or parameters, including unknown or malformed chainId. REST prepare and simulation failures also use this code
NOT_FOUNDResource does not exist
UPSTREAM_ERRORRPC or subgraph failure
RATE_LIMITEDTier rate limit exceeded
PREPARE_FAILUREMCP prepare-layer failure (may include requestId). Not returned by REST
UNAUTHORIZEDInvalid or revoked developer API key (HTTP 401). Does not fall back to the free tier
FORBIDDENCredential is not allowed for this request (HTTP 403). Includes MCP rejecting Builder cts_… sessions and :me routes without Builder
AUTH_RATE_LIMITEDToo many failed auth attempts from this IP (HTTP 429)
API_DISABLEDREST is temporarily unavailable (HTTP 503)

Unsupported REST ?chainId= (for example 1 or not-a-chain) returns 400 with code: "VALIDATION_ERROR" and a message such as Unsupported chainId 1. See Chain selection.

Validation errors

Write endpoints may include an issues array with field-level details:

{
"error": "Validation failed",
"code": "VALIDATION_ERROR",
"issues": [
{ "path": "from", "message": "Invalid address" }
]
}

Prepare failures

Include requestId when reporting prepare issues.

REST prepare and simulation failures return code: "VALIDATION_ERROR". MCP prepare-layer failures return code: "PREPARE_FAILURE".

Simulation failures on MCP throw before the tool result is returned.